package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.MaterialPlan;
import com.example.demo.service.MaterialPlanService;
import com.example.demo.mapper.MaterialPlanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 18364
* @description 针对表【material_plan】的数据库操作Service实现
* @createDate 2025-01-10 13:29:46
*/
@Service
public class MaterialPlanServiceImpl extends ServiceImpl<MaterialPlanMapper, MaterialPlan>
    implements MaterialPlanService{
    @Autowired
    MaterialPlanMapper materialPlanMapper;

    @Override
    public MaterialPlan selectByInfo(String planNumber) {
        QueryWrapper<MaterialPlan> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("planNumber",planNumber);
        queryWrapper.orderByDesc("id");
        return materialPlanMapper.selectOne(queryWrapper);
    }

    @Override
    public Integer deleteById(Integer id) {
        return materialPlanMapper.deleteById(id);
    }
}




